<#assign module="driver"/>

<@override name="header">
    <link rel="stylesheet" href="${ctx}/assets/css/datetimepicker.css">
    <link rel="stylesheet" href="${ctx}/assets/css/bootstrap-multiselect.css">
    <style>
        .removedriver {
            cursor: pointer
        }
    </style>
</@override>
<@override name="body">
    <div class="tabbable tabs-left">
        <div class="row">
            <div class="col-xs-12 col-md-10">
                <div class="orders-navt">
                    <ul class="orders-nav">
                        <@shiro.hasPermission name='servicePersonal'>
                            <li style="width:90px;"><a href="${ctx}/driver/list">服务人员</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='drivergrade'>
                            <li style="width:110px;"><a href="${ctx}/drivergrade/list">服务人员等级</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='driverapply'>
                            <li><a href="${ctx}/driverapply/list">申请</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='callLog'>
                            <li style="width:90px;"><a href="${ctx}/driver/recordlist">通话记录</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='notice'>
                            <li><a href="${ctx}/notice/list">通知</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='announcement'>
                            <li style="width:90px;"><a href="${ctx}/driver/announcementList">公告</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='drivermoney' >
                            <li style="width:90px;"><a href="${ctx}/driver/drivermoney">批量操作</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='drivermoney' >
                            <li style="width:110px;" class="orders-click"><a
                                        href="${ctx}/driver/driverReward">服务人员奖励</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='driverenchashment'>
                            <li style="width:100px;"><a href="${ctx}/driverenchashment/list">申请提现</a></li>
                            <li style="width:120px;"><a href="${ctx}/driverRebateenchashment/extendList">申请提取推广奖励</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='driverloginrecord'>
                            <li style="width:90px;"><a href="${ctx}/driver/loginlist">登录日志</a></li>
                        </@shiro.hasPermission>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="tab-content">
        <div class="container-fluid margin-top">
            <div class="row">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            服务人员奖励
                        </div>
                        <div class="panel-body">
                            <form id="submit_form" class="form-horizontal" method="post">
                                <@shiro.isMainCompany>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label"><em>*</em>服务人员公司：</label>
                                        <div class="col-sm-3">
                                            <select class="form-control" id="companyIds" name="companyIds"
                                                    multiple="multiple" required>
                                                <#if companys??>
                                                    <#list companys as company>
                                                        <option value="${company.id}">${company.abbreviation?if_exists}</option>
                                                    </#list>
                                                </#if>
                                            </select>
                                        </div>
                                    </div>
                                </@shiro.isMainCompany>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label"><em>*</em>订单类型：</label>
                                    <div class="col-sm-3">
                                        <select class="form-control" id="orderType" name="orderType" required>
                                            <option value="">--请选择--</option>
                                            <@daijia>
                                                <option value="daijia">代驾</option>
                                            </@daijia>
                                            <@zhuan>
                                                <option value="zhuanche">专车</option>
                                            </@zhuan>
                                            <@pao>
                                                <option value="errand">跑腿</option>
                                            </@pao>
                                            <@freight>
                                                <option value="freight">货运</option>
                                            </@freight>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label"><em>*</em>至少完成：</label>
                                    <div class="col-sm-3">
                                        <div class="input-group">
                                            <input class="form-control" id="finishAmounts" name="finishAmounts"
                                                   type="number" min="1" value="1" required/>
                                            <span class="input-group-addon">单</span>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label"><em>*</em>每单金额不低于：</label>
                                    <div class="col-sm-3">
                                        <div class="input-group">
                                            <input class="form-control" id="lowestMoney" name="lowestMoney"
                                                   type="number" min="1" required/>
                                            <span class="input-group-addon">元</span>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">完成期限：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control" id="start" name="start" type="text" required/>
                                    </div>
                                    <label style="float:left;" class="control-label">-</label>
                                    <div class="col-sm-3">
                                        <input class="form-control" id="end" name="end" type="text"/>
                                    </div>
                                </div>


                                <div class="form-group">
                                    <label class="col-sm-3 control-label"><em>*</em>奖励方式：</label>
                                    <div class="col-sm-6">
                                        <p class="form-control-static">
                                            <label style="padding-right:12px;">
                                                <input type="radio" name="rewardType" value="guding" checked="checked"/>
                                                固定金额
                                            </label>
                                            <label style="padding-right:12px;">
                                                <input type="radio" name="rewardType" value="percent"/> 百分比金额
                                            </label>
                                        </p>
                                        <span class="help-block">百分比金额为所有满足条件的订单总金额乘以百分比</span>
                                    </div>
                                </div>


                                <div class="form-group" id="guding_div">
                                    <label class="col-sm-3 control-label"><em>*</em>返现金额：</label>
                                    <div class="col-sm-3">
                                        <div class="input-group">
                                            <input class="form-control" id="guding" name="guding" type="number" min="1"
                                                   required/>
                                            <span class="input-group-addon">元</span>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group" id="percent_div" style="display:none;">
                                    <label class="col-sm-3 control-label"><em>*</em>返现比例：</label>
                                    <div class="col-sm-3">
                                        <div class="input-group">
                                            <input class="form-control" id="percent" name="percent" type="number"
                                                   min="1" required/>
                                            <span class="input-group-addon">%</span>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group" style="margin-left:10px;">
                                    <label class="col-sm-3 control-label"></label>
                                    <input id="submit_button" type="button" class="btn btn-primary" value="筛选">
                                </div>
                            </form>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--筛选详情-->
    <div class="form-horizontal">
        <div class="modal fade" id="dialog_driver" data-backdrop="static">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="false">&times;</button>
                        <h4 class="modal-title">筛选详情</h4>
                    </div>
                    <div class="modal-body">
                        <form action="" method="post">
                            <div id="driver_btn" class="row" style="margin-left:10px;">
                            </div>
                            <div class="form-group">
                                <div class="col-sm-12 margin-top" style="text-align:center;">
                                    <span>已筛选出</span><font color="red" id="number"/></font><span>位服务人员</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-12" style="text-align:center;">
                                    <input type="button" class="btn btn-primary" id="save" value="开始执行">
                                    <button type="button" class="btn btn-default" id="cancel">关闭</button>
                                </div>
                            </div>
                        </form>
                        <div class="progress" id="reward_process" style="display:none;">
                            <div class="progress-bar progress-bar-info progress-bar-striped active" style="width: 1%">
                                <span>0% 已完成</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-12" id="errormessage_div">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</@override>

<@override name="footer">
    <script src="${ctx}/assets/js/bootstrap-multiselect.js"></script>
    <script src="${ctx}/assets/js/datepicker.js"></script>
    <script src="${ctx}/assets/js/driver/driverreward.js"></script>
    <script>
        var main = false;
        <@shiro.isMainCompany>
        main = true;
        </@shiro.isMainCompany>
    </script>

</@override>
<@extends name="../layout.ftl"/>
